home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr22 / byte24.zip / DB.H < prev    next >
Text File  |  1992-01-05  |  2KB  |  65 lines

  1. /* database and file handling definitions for the byte benchmarks
  2. ** BYTE magazine, spring 1990
  3. ** Include when compiling benchfac.c and dbsubs.c.
  4. */
  5.  
  6. /* type codes */
  7. #define CHARCODE 0
  8. #define INTCODE 1
  9. #define CHARPTRCODE 2
  10. #define FLOATCODE 3
  11.  
  12. #define NAMESPACE 15
  13.  
  14. /* record structure definition */
  15.  
  16.     struct database_record {
  17.         unsigned int currflag;
  18.         unsigned int comp;    /* set for comparisons; 1=1st, 2=sec*/
  19.         unsigned int basenum;    /* set for baselines; 2=notebook, 3=desktop */
  20.         unsigned int proc;
  21.         unsigned int mhz;
  22.         char name[NAMESPACE];
  23.         double sieveres;    /* test results */
  24.         double sortres;
  25.         double imathres;
  26.         double movbres;
  27.         double movwores;
  28.         double movweres;
  29.         double movdores;
  30.         double movderes;
  31.         double fourbangres;
  32.         double forres;
  33.         double fiorres;
  34.         double fiowres;
  35.         double tpres;
  36.         double seekres;
  37.         double txposres;
  38.         double txscrollres;
  39.         double graphres;
  40.         double cpuNB;        /* indexes */
  41.         double fpuNB;
  42.         double diskNB;
  43.         double videoNB;
  44.         double cpuDT;
  45.         double fpuDT;
  46.         double diskDT;
  47.         double videoDT;
  48.         };
  49.  
  50. typedef struct database_record db_rec;
  51.  
  52. /* macros */
  53. #define offset_in_struc(x, y) (unsigned int)(&(((x*)0)->y))
  54.  
  55. /* function prototypes */
  56. char init_db( char, db_rec**, char *);
  57. int dump_db( char, db_rec**, char *);
  58. void free_db( char, db_rec**);
  59. int lin_search_db(char, char, void**,int,char, double);
  60. void sort_db( char, void**,int, char);
  61. void update_db(int, void**, int, char, double);
  62. char add_entry_db(char, char, db_rec**, char*);
  63. void dup_rec( void**, int, int);
  64.  
  65.